package day3_homework;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

public class _6 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int x=in.nextInt();

        Calendar a = Calendar.getInstance();
        a.set(x,0,1);

        SimpleDateFormat aa = new SimpleDateFormat("yyy年MM月dd星期E");
        int s=52;
        while (s>0){
            if (a.get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY){
                s--;
                System.out.println(aa.format(a.getTime()));
            }
            a.set(Calendar.DATE,a.get(Calendar.DATE)+1);
        }
    }
}
